from math import cos
l1,l2,w=input('input:').split(',')
pi=3.1415926
l1=int(float(l1))
l2=int(float(l2))
w=int(float(w))
x=l1**2+l2**2-2*l1*l2*cos(w/180*pi)
t=x**0.5
print(round(t,4)) 